
const day=24*60*60*1000;
const weekNames=[
    '周日',
    '周一',
    '周二',
    '周三',
    '周四',
    '周五',
    '周六',
];
export const getEndOfDay=(time=Date.now())=>{
    const date=new Date(time);
    date.setHours(23,59,59,999);
    return date;
};

export const getWeekName=(time)=>{
    const date=new Date(time);
    const todayEnd=getEndOfDay();
    if(time-todayEnd<=0){
        return '今天'
    }
    if(time-todayEnd<=day){
        return '明天'
    }
    return weekNames[date.getDay()];
};
export default getWeekName;